package com.zykj.evaluation.model

import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController


object Destinations {
    const val HOME_ROUTE = "home"
    const val LOGIN_ROUTE = "login"

}

class NavigationActions(navController: NavHostController) {
    val navigateToHome: () -> Unit = {
        navController.navigate(Destinations.HOME_ROUTE) {
            popUpTo(navController.graph.findStartDestination().id) {
                saveState = true
            }
            launchSingleTop = true
            restoreState = true
        }
    }
    val navigateToLogin: () -> Unit = {
        navController.navigate(Destinations.LOGIN_ROUTE) {
            popUpTo(navController.graph.findStartDestination().id) {
                saveState = true
            }
            launchSingleTop = true
            restoreState = true
        }
    }
}


sealed class DrawerContent {
    abstract fun content(): String
    data class SubjectContent(
        val id: Int,
        val name: String,
        val sort: Int,
        val content: String,
    ) : DrawerContent() {
        override fun content(): String {
            return content
        }
    }

    data class ReviewContent(
        val content: String,
    ) : DrawerContent() {

        override fun content(): String {
            return content
        }
    }

    data class TimeContent(
        val content: String,
    ) : DrawerContent() {

        override fun content(): String {
            return content
        }
    }
}


